//
//  KeyboardInputAccessoryView.m
//  MansApp
//
//  Created by lanou3g on 15/7/23.
//  Copyright (c) 2015年 ACH. All rights reserved.
//

#import "KeyboardInputAccessoryView.h"

@implementation KeyboardInputAccessoryView

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {

        self.soundButton = [UIButton buttonWithType:UIButtonTypeSystem];
        self.soundButton.frame = CGRectMake(kP6Height(40), kP6Height(5), kP6Height(25), kP6Height(30));
        [self.soundButton setBackgroundImage:[UIImage imageNamed:@"cm2_toptab_mike@3x"] forState:UIControlStateNormal];
        self.soundButton.tag = 100;
        
        self.picButton = [UIButton buttonWithType:UIButtonTypeSystem];
        self.picButton.frame = CGRectMake(self.soundButton.frame.origin.x + self.soundButton.bounds.size.width + kP6width(40), kP6Height(5), kP6width(40), kP6Height(30));
        [self.picButton setBackgroundImage:[UIImage imageNamed:@"resize_png_new"] forState:UIControlStateNormal];
        self.picButton.tag = 101;
        
        self.cameraButton = [UIButton buttonWithType:UIButtonTypeSystem];
        self.cameraButton.frame = CGRectMake(self.picButton.frame.origin.x + self.picButton.bounds.size.width + kP6Height(40), kP6Height(5), kP6Height(40), kP6Height(30));
      [self.cameraButton setBackgroundImage:[UIImage imageNamed:@"cm2_lrc_icn_photo_prs@2x"] forState:UIControlStateNormal];
        self.cameraButton.tag = 102;
        
        UIView *view = [[UIView alloc]initWithFrame:CGRectMake(self.cameraButton.frame.origin.x + self.cameraButton.bounds.size.width + kP6width(67), 3, 2, kP6Height(34))];
        view.backgroundColor = [UIColor colorWithRed:0 green:0 blue:128 / 255.0 alpha:0.7];
        
        
        self.keyboardButton = [UIButton buttonWithType:UIButtonTypeSystem];
        self.keyboardButton .frame = CGRectMake(self.cameraButton.frame.origin.x + self.cameraButton.bounds.size.width + kP6width(85), kP6Height(5), kP6width(50), kP6Height(35));
      [self.keyboardButton setBackgroundImage:[UIImage imageNamed:@"u=908483921,4213157701&fm=21&gp=0"] forState:UIControlStateNormal];
        self.keyboardButton .tag = 103;
        
        UIImageView *imageView = [[UIImageView alloc]initWithFrame:self.frame];
        imageView.image = [UIImage imageNamed:@"cm2_edit_cmt_bg@3x"];
        [self addSubview:imageView];
        [self addSubview:view];
        [self addSubview:self.soundButton];
        [self addSubview:self.picButton];
        [self addSubview:self.cameraButton];
        [self addSubview:self.keyboardButton];
  
        
        
    }
    return self;
}


- (void)addTarget:(id)target action:(SEL)action forControlEvents:(UIControlEvents)events{
    
    
    [self.soundButton addTarget:target action:action forControlEvents:events];
    [self.picButton addTarget:target action:action forControlEvents:events];
    [self.cameraButton addTarget:target action:action forControlEvents:events];
    [self.keyboardButton addTarget:target action:action forControlEvents:events];
    
    
    
}


@end
